package com.yanghs.common.entity.hbm;

import java.io.Serializable;

/**
 * @author yanghs
 * @Description:
 * @date 2018/3/14 21:28
 */
public class UserRole implements Serializable {
    private static final long serialVersionUID = 1L;
    private String id;
    private String userid;
    private String roleid;
    // 不需要序列化 避免hibernate的错误
    private transient Userinfo userinfoByUserid;
    private transient Roleinfo roleinfoByRoleid;



    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getUserid() {
        return userid;
    }

    public void setUserid(String userid) {
        this.userid = userid;
    }

    public String getRoleid() {
        return roleid;
    }

    public void setRoleid(String roleid) {
        this.roleid = roleid;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        UserRole userRole = (UserRole) o;

        if (id != null ? !id.equals(userRole.id) : userRole.id != null) return false;
        if (userid != null ? !userid.equals(userRole.userid) : userRole.userid != null) return false;
        if (roleid != null ? !roleid.equals(userRole.roleid) : userRole.roleid != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (userid != null ? userid.hashCode() : 0);
        result = 31 * result + (roleid != null ? roleid.hashCode() : 0);
        return result;
    }

    public Userinfo getUserinfoByUserid() {
        return userinfoByUserid;
    }

    public void setUserinfoByUserid(Userinfo userinfoByUserid) {
        this.userinfoByUserid = userinfoByUserid;
    }

    public Roleinfo getRoleinfoByRoleid() {
        return roleinfoByRoleid;
    }

    public void setRoleinfoByRoleid(Roleinfo roleinfoByRoleid) {
        this.roleinfoByRoleid = roleinfoByRoleid;
    }
}
